<template>
  <div class="message-dialog">
    <el-dialog :before-close="handlePush" :visible.sync="dialog" title="发送私信">
      <el-form :model="form" label-width="130px">
        <el-form-item label="收件人">
          <el-input v-model="form.username" style="width:260px"/>
        </el-form-item>
        <el-form-item label="内容">
          <el-input v-model="form.content" :rows="10" style="width:260px" type="textarea"/>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="handlePush">发 送</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    visibleDialog: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      form: {
        username: '学生会长',
        content: ''
      }
    }
  },
  computed: {
    dialog() {
      return this.visibleDialog
    }
  },
  methods: {
    handlePush() {
      this.$emit('closeMessage')
    }
  }
}
</script>

<style lang="scss">
.message-dialog {
  .el-dialog {
    width:600px;
    border-radius:5px;
  }
}
</style>
